<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

namespace T4\OUTPUT;

class HTML extends \T4\Output {
    
    private $template;
    
    public function __construct($template) {
        $this->setTemplate($template);
    }
    
    public function setTemplate($template) {
        $this->template = $template;
    }

    public function headers() {
	header('Content-type: text/html; charset=UTF-8');
    }
    
    public function prepare($data) {
        $view = new \T4\View();
        foreach ($data as $key => $value)
            $view->assign($key, $value);
        return $view->render($this->template);
    }
    
}